From 8602a751efb640f4c08bacb42ce9efdf596e6f28 Mon Sep 17 00:00:00 2001 From: Rob Church Date: Fri, 12 May 2006 17:47:53 +0000 Subject: [PATCH] Groups which won't hit the rate limiter now configurable with $wgRateLimitsExcludedGroups --- RELEASE-NOTES | 3 ++- includes/DefaultSettings.php | 8 ++++++++ includes/User.php | 12 +++++++----- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 864a353ad9..9252aecd92 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -248,7 +248,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 5915) Update to Indonesian localisation (id) * (bug 5913) Update for German localisation (de) * (bug 5905) Plural support for Bosnian localisation (bs) - +* Groups which won't hit the rate limiter now configurable with + $wgRateLimitsExcludedGroups == Compatibility == diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 3637407559..de6b76b72d 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -1823,6 +1823,9 @@ $wgRateLimits = array( 'ip' => null, 'subnet' => null, ), + 'mailpassword' => array( + 'ip' => NULL, + ), ); /** @@ -1830,6 +1833,11 @@ $wgRateLimits = array( */ $wgRateLimitLog = null; +/** + * Array of groups which should never trigger the rate limiter + */ +$wgRateLimitsExcludedGroups = array( 'sysop', 'bureaucrat' ); + /** * On Special:Unusedimages, consider images "used", if they are put * into a category. Default (false) is not to count those as used. diff --git a/includes/User.php b/includes/User.php index cb6a6de588..b109e803f2 100644 --- a/includes/User.php +++ b/includes/User.php @@ -525,15 +525,17 @@ class User { * @public */ function pingLimiter( $action='edit' ) { - global $wgRateLimits; + global $wgRateLimits, $wgRateLimitsExcludedGroups; if( !isset( $wgRateLimits[$action] ) ) { return false; } - if( $this->isAllowed( 'delete' ) ) { - // goddam cabal - return false; + + # Some groups shouldn't trigger the ping limiter, ever + foreach( $this->getGroups() as $group ) { + if( array_search( $group, $wgRateLimitsExcludedGroups ) !== false ) + return false; } - + global $wgMemc, $wgDBname, $wgRateLimitLog; $fname = 'User::pingLimiter'; wfProfileIn( $fname ); -- 2.20.1